<?php foreach($post_edit as $post_edit_rec): ?>
	<form id="frm-new-post" action="<?php echo site_url('user/store_post') ?>" method="post" enctype="multipart/form-data">
		<h3 id="newpost-title">
			<i class="fa fa-pencil"></i> Edit Post
		</h3>

		<?php if($this->session->flashdata('notif_status') != ""): ?>
			<?php if($this->session->flashdata('notif_status') == "1"): ?>
				<div class="notif notif-sukses"><?php echo $this->session->flashdata('notif'); ?></div>
			<?php elseif($this->session->flashdata('notif_status') == "0"): ?>
				<div class="notif notif-gagal"><?php echo $this->session->flashdata('notif'); ?></div>
			<?php endif; ?>
		<?php endif; ?>

		<label>Judul</label>
		<input type="text" name="post_title" class="form-control input-sm" value="<?php echo $post_edit_rec['jonu_post_title'] ?>" />
		<label>Konten</label>
		<textarea name="post_content" class="form-control input-sm"><?php echo $post_edit_rec['jonu_post_content'] ?></textarea>
		<label>Kategori</label>
		<select name="post_category" class="form-control input-sm">		
			<?php foreach($cat as $cat_rec): ?>
				<?php if($post_edit_rec['jonu_category_id'] == $cat_rec['jonu_category_id']): ?>
					<option value="<?php echo $cat_rec['jonu_category_id'] ?>" selected="selected"><?php echo $cat_rec['jonu_category_name'] ?></option>
				<?php else: ?>
					<option value="<?php echo $cat_rec['jonu_category_id'] ?>"><?php echo $cat_rec['jonu_category_name'] ?></option>
				<?php endif; ?>				
			<?php endforeach; ?>
		</select>		
		<label>Lokasi</label>	
		<fieldset class="fisarmonica">
			<div id="maps" style="margin-bottom: 10px;"></div>
			<div class="input_dinamici">			
				<span for="latitude"><input class="form-control input-sm" type="hidden" name="post_latitude" id="latitude"/></span>
				<span for="longitude"><input class="form-control input-sm" type="hidden" name="post_longitude" id="longitude"/></span>
			</div>
		</fieldset>
		<div for="address" name="post_location" class="input-group" style="margin-bottom: 10px;">
			<input type="text" class="form-control input-sm" name="post_location" id="address" placeholder="Tulis, lalu tekan tombol cari" value="<?php echo $post_edit_rec['jonu_post_location'] ?>" required="required"/>
			<span class="input-group-btn">
				<button id="getmap" class="btn btn-sm btn-default" type="button"><i class="fa fa-search"></i></button>
			</span>
		</div>   	

		<label>Foto</label>
		<input type="file" name="post_foto"  style="margin-bottom: 15px;" />
		<img src="<?php echo base_url("asset/img/posts-image/$post_edit_rec[jonu_post_image]") ?>" width="100px" height="auto"/ style="display:block;margin-bottom:15px;"/>
		<input type="submit" class="btn btn-jonu btn-sm" value="Publish Post" name="btn_new_post" />
	</form>
<?php endforeach; ?>